#ifndef WIN_TCP_CLIENT_MSG_QUEUE_H
#define WIN_TCP_CLIENT_MSG_QUEUE_H

#include <mutex>
#include <condition_variable>
#include <queue>

namespace zs
{
    class CMsgQueue
    {
        CMsgQueue() = default;
    public:
        static CMsgQueue& get_instance()
        {
            static CMsgQueue instance;
            return instance;
        }
        ~CMsgQueue() = default;
        std::string pop_msg();
        void push_msg(const std::string &msg);
    private:
        const size_t max_size_{1000};
        std::queue<std::string> msg_queue_{};
        std::mutex mutex_{};
        std::condition_variable cond_{};
    };
}




#endif //WIN_TCP_CLIENT_MSG_QUEUE_H
